package com.emokili.ewa.common.exception;

/**
 * @Description: 错误状态码枚举
 * @Created: with IntelliJ IDEA.
 * @author: 夏沫止水
 * @createTime: 2020-05-27 17:29
 *
 * 错误码和错误信息定义类
 * 1. 错误码定义规则为5为数字
 * 2. 前两位表示业务场景，最后三位表示错误码。例如：100001。10:通用 001:系统未知异常
 * 3. 维护错误码后需要维护错误描述，将他们定义为枚举形式
 * 错误码列表：
 *  10: 通用
 *      001：参数格式校验
 *      002：短信验证码频率太高
 *  11: 商品
 *  12: 订单
 *  13: 购物车
 *  14: 物流
 *  15：用户
 *
 *
 *
 **/

public enum BizCodeEnum {

    UNKNOW_EXCEPTION("10000","系统未知异常"),
    VAILD_EXCEPTION("10001","参数格式校验失败"),
    TO_MANY_REQUEST("10002","请求流量过大，请稍后再试"),
    SMS_CODE_EXCEPTION("10003","验证码获取频率太高，请稍后再试"),
    PRODUCT_UP_EXCEPTION("11000","商品上架异常"),
    USER_EXIST_EXCEPTION("15001","存在相同的用户"),
    //Please use your username and password
    EMAIL_EXIST_EXCEPTION("15002","存在相同的邮箱"),
    NO_STOCK_EXCEPTION("21000","商品库存不足"),
    //Please use your username and password
    LOGINACCT_PASSWORD_EXCEPTION("15003","账号或密码错误"),
    USER_TOKEN_NOT_EXIST("10004","TOKEN IS NOT EXIST"),
    SERIAL_NUMBER_INVALID("10005","The number you have enter appears to be invalid"),
    SERIAL_NUMBER_BINDED("10006","Your Frame appears to be paired to an account already! Please contact customer support"),
    DEVICE_NOT_BIND("10007","Your frame is not bind"),
    LOGIN_OR_PASSWORD_ERROR("10008","Please use your username and password"),
    NAME_IS_NULL("11001","Please input your friend name"),
    USER_NAME_OR_EMAIL_IS_NULL("11002","Please input your friend username or email"),
    USER_NAME_OR_EMAIL_NOT_FOUND("11003","Username or email not found"),
    ;

    private String code;

    private String message;

    BizCodeEnum(String code, String message) {
        this.code = code;
        this.message = message;
    }

    public String getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}
